home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
PIL
/
GdImageFile.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2008-10-13
|
2KB
|
49 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
__version__ = '0.1'
import string
import Image
import ImageFile
import ImagePalette
def i16(c):
return ord(c[1]) + (ord(c[0]) << 8)
class GdImageFile(ImageFile.ImageFile):
format = 'GD'
format_description = 'GD uncompressed images'
def _open(self):
s = self.fp.read(775)
self.mode = 'L'
self.size = (i16(s[0:2]), i16(s[2:4]))
tindex = i16(s[5:7])
if tindex < 256:
self.info['transparent'] = tindex
self.palette = ImagePalette.raw('RGB', s[7:])
self.tile = [
('raw', (0, 0) + self.size, 775, ('L', 0, -1))]
def open(fp, mode = 'r'):
if mode != 'r':
raise ValueError('bad mode')
if type(fp) == type(''):
import __builtin__ as __builtin__
filename = fp
fp = __builtin__.open(fp, 'rb')
else:
filename = ''
try:
return GdImageFile(fp, filename)
except SyntaxError:
raise IOError('cannot identify this image file')